package com.service.component.relation.services;

import com.service.component.common.CommonResult;
import com.service.component.permissions.entity.Permission;
import com.service.component.relation.entity.GroupPremRelation;
import com.service.component.relation.entity.GroupRoleRelation;
import com.service.component.relation.entity.RolePremRelation;
import com.service.component.relation.entity.UserGroupRelation;
import com.service.component.role.entity.Role;

import java.util.List;

public interface RelationServices<T> {

    CommonResult <T> insertOrUpdateRelation(T t);

    List<Role> getUserRolesByUserId(String userId);

    List<Permission>  getUserPermissionByUserId(String userId);

    CommonResult deleteUserFilterPermByUserIdAndPermId(String userId,String PermId);

    CommonResult deleteUserFilterRoleByUserIdAndPermId(String userId, String roleId);

    CommonResult deleteGroupFilterPermByUserIdAndPermId(String groupId,String PermId);

    CommonResult deleteGroupFilterRoleByUserIdAndPermId(String groupId, String roleId);

    CommonResult deleteGroupRoleByUserIdAndPermId(String groupId, String roleId);

    CommonResult deleteGroupPermByUserIdAndPermId(String groupId, String permId);

    CommonResult deleteUserRoleByUserIdAndPermId(String userId, String roleId);

    CommonResult deleteUserPermByUserIdAndPermId(String userId, String permId);

    CommonResult deleteUserGroupByUserIdAndPermId(String userId, String groupId);

    CommonResult deleteRolePermByRoleIdAndPermId(String roleId, String permId);
}
